<?php
###############   COPYLEFT GPLv3 LICENSE   ###############
##
## JFX Version 0.2.9
## Website Management Software
## www.jfxcms.com
##
## Copyright 2009 GPLv3 - http://www.opensource.org/licenses/gpl-3.0.html
##
## Anthony Gallon
## oi_antz@hotmail.com
##
## Permission is hereby granted to any person having a copy of this software
## to freely use and modify as required so long as the copyright notices
## and branding remain intact.
##
## Full license details available at http://www.jfxcms.com/license
##
###############   COPYLEFT GPLv3 LICENSE   ###############


if(get('JFXGetAjaxContent')!=='1'){



if(!isset($USER->JFX_Theme_Default_MenuOpen)) $USER->JFX_Theme_Default_MenuOpen = 0;
$USER->JFX_Theme_Default_MenuOpen = (int)  $USER->JFX_Theme_Default_MenuOpen;

$jsFiles = array(
    'jquery/jquery-1.4.2.min.js',
    'jquery/jquery-ui-1.8.2.custom.min.js',
	'jquery/jquery-treeview/jquery.treeview.min.js',
    'jquery/jquery.form.js',
	'jquery/jeditable.js',
	'jquery/colorpicker/js/colorpicker.js',
    'thickbox-compressed.js',
    'json.min.js',
	'jfx/base.js',
    'jfx/admin-menu.js',
    'jfx/admin-blocks.js',
	'jfx/admin-tabber.js'
);


foreach($jsFiles as $file){
	$VIEW->addJsLink($CONFIG->baseUrl.'/jfx/'.$file);
}

$code = explode('_', $USER->lang);
$SMARTY->assign('langCode', strtolower($code[1]));
$SMARTY->assign('langTitle', $USER->lang);
$SMARTY->assign('workspaceTitle', $CORE->getContentLang('workspace_title', $USER->workspace));

$cssFiles = array(
    'admin.css',
    'forms.css',
    'admin-menu.css',
    'admin-layout.css',
    'thickbox.css',
    'admin-blocker.css',
    'jquery.treeview.css',
    //'ui-lightness/jquery-ui-1.7.1.custom.css'
    'ui-default-blue/accordion-default-blue.css'
);

$this->addStylesheet(implode(',', $cssFiles));

$VIEW->addCssLink($CONFIG->baseUrl.'/jfx/jquery/colorpicker/css/colorpicker.css');

$VIEW->addEndBody('<script src="'.$CONFIG->baseUrl.'/jfx/codepress/codepress.js" type="text/javascript"></script>');
$VIEW->addEndBody('<script src="'.$CONFIG->baseUrl.'/jfx/wz_tooltip/wz_tooltip.js" type="text/javascript"></script>');



}// end if get('JFXGetAjaxContent')!==1
else{
	// yes ajax content

}





$extra = '';

if(!empty($this->hasExtra) && !$this->hasExtra){
	$extra = 'JFX_Theme_Default_MakeAjaxLinks();';
	$this->hasExtra = true;
}

$js = <<<JS

$(document).ready(function(){

    {$extra}

});
JS;

$VIEW->addJs($js);